// Collision by Andrew Davies

"use strict";

function collisionAABBonAABB( tlA, brA, tlB, brB )
{
	if( ( brA.x <= tlB.x ) ||
		( tlA.x >= brB.x ) ||
		( brA.y <= tlB.y ) ||
		( tlA.y >= brB.y ) )
	{
		return false;
	}
	
	return true;
}

function collisionAABBonExternalAABB( tl, br, extTl, extBr )
{
	if( ( br.x >= extBr.x ) ||
		( tl.x <= extTl.x ) ||
		( br.y >= extBr.y ) ||
		( tl.y <= extTl.y ) )
	{
		return true;
	}
	
	return false;
}
